//
//  JYTPopsexMenu.h
//  JYT_IOS
//
//  Created by nxa-tankeke on 17/1/13.
//  Copyright © 2017年 nxa-yuanguoxiang. All rights reserved.
//

#import <UIKit/UIKit.h>
typedef NS_ENUM(NSInteger , JYTPopsexMenuType) {
    PopupMenuTypeDefault = 0,
    PopupMenuTypeDark
};

@class JYTPopsexMenu;
@protocol JYTPopsexMenuDelegate <NSObject>

@optional
- (void)popsexMenuDidSelectedAtIndex:(NSInteger)index popupMenu:(JYTPopsexMenu *)popupMenu;
- (void)popupMenuBeganDismiss;
- (void)popupMenuDidDismiss;

@end


@interface JYTPopsexMenu : UIView

@property (nonatomic, assign) CGFloat cornerRadius;

@property (nonatomic, assign , getter=isShadowShowing) BOOL isShowShadow;

@property (nonatomic, assign) BOOL dismissOnSelected;

@property (nonatomic, assign) BOOL dismissOnTouchOutside;

@property (nonatomic, assign) CGFloat fontSize;

@property (nonatomic, strong) UIColor * textColor;

@property (nonatomic, assign) CGFloat offset;

@property (nonatomic, assign) JYTPopsexMenuType type;

@property (nonatomic, weak) id <JYTPopsexMenuDelegate> delegate;

+ (instancetype)showAtPoint:(CGPoint)point
                     titles:(NSArray *)titles
                      icons:(NSArray *)icons
                  menuWidth:(CGFloat)itemWidth
                   delegate:(id<JYTPopsexMenuDelegate>)delegate;


+ (instancetype)showRelyOnView:(UIView *)view
                        titles:(NSArray *)titles
                         icons:(NSArray *)icons
                     menuWidth:(CGFloat)itemWidth
                      delegate:(id<JYTPopsexMenuDelegate>)delegate;


- (void)dismiss;

@end
